package ru.rchervot.sanasar.client.gin;

import ru.rchervot.sanasar.client.rpc.CachedBatchingService;
import ru.rchervot.sanasar.client.rpc.RPCService;
import ru.rchervot.sanasar.client.rpc.RPCServiceAsync;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.HandlerManager;
import com.google.inject.Inject;
import com.google.inject.Provider;

public class ProviderService implements Provider<RPCServiceAsync> {
	@Inject HandlerManager eventBus;
	
	@Override
	public RPCServiceAsync get() {
		return new CachedBatchingService(eventBus, 
				(RPCServiceAsync)GWT.create(RPCService.class));
	}
}
